Home GnuPG
Diffusion GnuPG 66834eb838a8

gpgscm: Use a static pool of cells for small integers.
66834eb838a8Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

gpgscm: Use a static pool of cells for small integers.

* tests/gpgscm/scheme-private.h (struct scheme): New fields for the
static integer cells.
* tests/gpgscm/scheme.c (_alloc_cellseg): New function.
(alloc_cellseg): Use the new function.
(MAX_SMALL_INTEGER): New macro.
(initialize_small_integers): New function.
(mk_small_integer): Likewise.
(mk_integer): Return a small integer if possible.
(_s_return): Do not free 'op' if it is a small integer.
(s_save): Use a small integer to box the opcode.
(scheme_init_custom_alloc): Initialize small integers.
(scheme_deinit): Free chunk of small integers.
* tests/gpgscm/scheme.h (USE_SMALL_INTEGERS): New macro.
  • Signed-off-by: Justus Winter <justus@g10code.com>

Details

Provenance
justusAuthored on Nov 16 2016, 11:29 AM
Parents
rG893a3f7fb460: tests: Delay querying the avaliable algorithms.
Branches
Unknown
Tags
Unknown

Event Timeline

Justus Winter <justus@g10code.com> committed rG66834eb838a8: gpgscm: Use a static pool of cells for small integers. (authored by Justus Winter <justus@g10code.com>).Nov 22 2016, 12:09 PM