diff options
author | Dan Gudmundsson <[email protected]> | 2015-05-05 09:31:18 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2015-05-05 09:31:18 +0200 |
commit | 676500a8042165ae3391275fb638471a5a05b25f (patch) | |
tree | f38c152677c66e13c4bf79df0dd46e5140812441 /lib/wx/c_src/wxe_helpers.h | |
parent | 727338fe38bb9aae0ea4d9069d8a1d6e1694a2dd (diff) | |
parent | 60229a03667a9bac8917a78c922bec4885d2d53f (diff) | |
download | otp-676500a8042165ae3391275fb638471a5a05b25f.tar.gz otp-676500a8042165ae3391275fb638471a5a05b25f.tar.bz2 otp-676500a8042165ae3391275fb638471a5a05b25f.zip |
Merge branch 'dgud/wx/optimize-queues'
* dgud/wx/optimize-queues:
wx: Fix delete object
wx: Optimize command queues
wx: Optimize OpenGL invocations
Diffstat (limited to 'lib/wx/c_src/wxe_helpers.h')
-rw-r--r-- | lib/wx/c_src/wxe_helpers.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/lib/wx/c_src/wxe_helpers.h b/lib/wx/c_src/wxe_helpers.h index 659bc666c6..ec3a5debdb 100644 --- a/lib/wx/c_src/wxe_helpers.h +++ b/lib/wx/c_src/wxe_helpers.h @@ -39,14 +39,14 @@ class wxeMetaCommand : public wxEvent ErlDrvPDL pdl; }; -class wxeCommand : public wxObject +class wxeCommand { public: - wxeCommand(int fc,char * cbuf,int buflen, wxe_data *); + wxeCommand(); virtual ~wxeCommand(); // Use Delete() - wxeCommand * Save() {ref_count++; return this; }; - void Delete() {if(--ref_count < 1) delete this;}; + wxeCommand * Save() { return this; }; + void Delete(); ErlDrvTermData caller; ErlDrvTermData port; @@ -54,7 +54,27 @@ class wxeCommand : public wxObject char * buffer; int len; int op; - int ref_count; + char c_buf[64]; // 64b covers 90% of usage +}; + +class wxeFifo { + public: + wxeFifo(unsigned int size); + virtual ~wxeFifo(); + + void Add(int fc, char * cbuf,int buflen, wxe_data *); + void Append(wxeCommand *Other); + + wxeCommand * Get(); + + void Realloc(); + + unsigned int m_max; + unsigned int m_first; + unsigned int m_n; + unsigned int m_orig_sz; + wxeCommand *m_q; + wxeCommand *m_old; }; class intListElement { |