Skip to content

Commit

Permalink
Attempt to clarify usage with thread-pool extension and use uint32_t …
Browse files Browse the repository at this point in the history
…over size_t
  • Loading branch information
jatinchowdhury18 committed Oct 17, 2024
1 parent a65ba57 commit 1b1a68e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/clap/ext/draft/scratch-memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ typedef struct clap_host_scratch_memory {
// the requested scratch size can be de-allocated by the
// host when the plugin is de-activated.
//
// In the context of plugins and hosts that implement
// the "thread-pool" extension, scratch memory is assumed
// to be "thread-local". The plugin should request the maximum
// amount of scratch memory that it will need on a single
// thread. Accordingly, the host must ensure that each
// thread can independently provide the requested amount
// of scratch memory.
//
// [main-thread & being-activated]
bool(CLAP_ABI *pre_reserve)(const clap_host_t *host, size_t scratch_size_bytes);
bool(CLAP_ABI *reserve)(const clap_host_t *host, uint32_t scratch_size_bytes);

// Asks the host for the previously requested scratch memory.
// If the host returned "true" when scratch memory was requested,
Expand Down

0 comments on commit 1b1a68e

Please sign in to comment.