I don't see why either. I just wanted to check here to see if someone did have an issue before proceeding.
Best, Travis On Wednesday, May 26, 2021 at 8:23:02 PM UTC+10 dim...@gmail.com wrote: > On Wed, May 26, 2021 at 8:04 AM 'jonatha...@googlemail.com' via > sage-devel <sage-...@googlegroups.com> wrote: > > > > Are there objections of adding this new standard package, which consists > of the code from `ext/memory_allocator.*`? > > > > This is now https://trac.sagemath.org/ticket/31591. > > as it's just code refactoring, I don't see why this should be an issue. > > > > > I would like to put it on `github.com/sagemath` > <http://github.com/sagemath> but need either help or permissions to do so. > > > > The new package does not depend on cysignals anymore for the following > reasons: > > - Cysignals is not installable on windows without cygwin. > > - Cysignals is used in case of `sig_on`/`sig_off` around > `MemoryAllocator` allocation methods. However this is unsafe and incorrect > usage of `sig_on`/`sig_off` as only pure C/C++ code may be executed within > and extension class cdef methods that involve `self` are not pure C/C++ > (they also do not allow to be declared `nogil`). Currently, such usage is > not the case in sage. > > > > If you have objections, concerns or other comments, please put them here > or directly on #31591. > > > > Thank you, > > > > Jonathan > > jonatha...@googlemail.com schrieb am Montag, 29. März 2021 um 23:43:34 > UTC+2: > >> > >> On 29.03.21 21:53, Matthias Koeppe wrote: > >> > >> On Monday, March 29, 2021 at 12:08:36 PM UTC-7 > jonatha...@googlemail.com wrote: > >>> > >>> I think in case of a pxd files things are a bit different. If someone > uses cysignals and memory_allocator in the same place, e.g. > >>> > >>> cdef MemoryAllocator mem = MemoryAllocator() > >>> sig_on() > >>> foo = mem.malloc(1000) > >>> sig_off() > >>> > >>> this would have to recompile the corresponding pxd file. So one could > check in that pxd file, whether cysignals is present or not. So I think > this could be set up, such that any project cimporting from > memory_allocator that requires cysignals has memory_allocator with > cysignals support. > >> > >> Right. If an importing project declares both memory_allocator and > cysignals as "build-system requires" in pyproject.toml, then it can make > use of both; so conditionalization memoryallocator.pxd based on > cython_compile_time_env does make sense. > >> > >> I didn't figure this out until after you showed me the reference. > >> > >> conditionalization based on cython_compile_time_env might be hard > though. There is no such thing as > >> > >> try: > >> from cysignals.signals cimport sig_on, sig_off > >> except: > >> from .signals_backup cimport sig_on, sig_off > >> > >> One thing that one may try is basically the following: > >> > >> cdef void (*sig_block_pt)() > >> cdef void (*sig_unblock_pt)() > >> > >> if has_cysignals: > >> # replace sig_block, sig_unblock properly > >> else: > >> # replace by pass-functions > >> > >> However, this probably needs an update of cysignals, as we need a way > to access the addresses of sig_block/sig_unblock on runtime (which is the > cython_compile_time_env). > >> > >> > >> The question remains, is it worth it? Do we need/want > sig_block/sig_unblock for MemoryAllocator? > >> > >> > >> -- > >> You received this message because you are subscribed to a topic in the > Google Groups "sage-devel" group. > >> To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sage-devel/6u1VuXJE7wE/unsubscribe. > >> To unsubscribe from this group and all its topics, send an email to > sage-devel+...@googlegroups.com. > >> > >> To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-devel/f619d534-43b8-4fc9-aaaf-91d2db52a4b6n%40googlegroups.com > . > > > > -- > > You received this message because you are subscribed to the Google > Groups "sage-devel" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to sage-devel+...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-devel/eca09c24-6d63-494f-8f4f-0529d5db7974n%40googlegroups.com > . > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/7f166b15-7d40-46d0-9282-0f1e23b394c3n%40googlegroups.com.