I propose removing the sig_block / sig_unblock from MemoryAllocator alltogether.

I think it is really bad practice to put an extension class method into sig_on / sig_off and this would be the only use case that this is good for anyway (I doubt that this is safe in the first place -- MemoryAllocator does not use sig_block / sig_unblock to assure that the memory pointers are stored properly). I think the cysignals allocation functions are mostly used, because they check, whether the allocation was successful (and raise an error if not).

On 29.03.21 18:29, Matthias Koeppe wrote:
On Monday, March 29, 2021 at 9:21:05 AM UTC-7 jonatha...@googlemail.com wrote:

    On Mar 29, 2021 5:26 PM, Matthias Koeppe <matthia...@gmail.com>
    wrote:

    > This suggestion is not compatible with modern Python packaging
    (PEP-517/518). There is no such thing as an "optional build
    dependency".

    Is it acceptable to build different versions depending on whether
    a package is found?

You don't find an installed package at build time. Build isolation provides a fixed set of packages -- that you define in pyproject.toml [build-system] requires. See e.g. https://snarky.ca/what-the-heck-is-pyproject-toml/

Thank you for providing the reference.

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. As noted above, I would vote for dropping the sig_block / sig_unblock in MemoryAllocator alltogether.



--
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 <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+unsubscr...@googlegroups.com <mailto:sage-devel+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/c3abeea5-8413-479b-8303-74c5cbf0159cn%40googlegroups.com <https://groups.google.com/d/msgid/sage-devel/c3abeea5-8413-479b-8303-74c5cbf0159cn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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/db52fd96-94f6-9ea4-fdeb-3431d6490247%40gmail.com.

Reply via email to