Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: mojo/public/go/system/c_allocators.c

Issue 860193002: go/system: adding two-phase data pipe methods (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/go/system/c_allocators.h ('k') | mojo/public/go/system/data_pipe.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/go/system/c_allocators.h" 5 #include "mojo/public/go/system/c_allocators.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include "mojo/public/c/system/core.h" 8 #include "mojo/public/c/system/core.h"
9 9
10 struct WaitParams MallocWaitParams() { 10 struct WaitParams MallocWaitParams() {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 struct WriteDataParams p; 150 struct WriteDataParams p;
151 p.num_bytes = (uint32_t*)malloc(sizeof(uint32_t)); 151 p.num_bytes = (uint32_t*)malloc(sizeof(uint32_t));
152 p.elements = (void*)malloc(length * sizeof(void)); 152 p.elements = (void*)malloc(length * sizeof(void));
153 return p; 153 return p;
154 } 154 }
155 155
156 void FreeWriteDataParams(struct WriteDataParams p) { 156 void FreeWriteDataParams(struct WriteDataParams p) {
157 free(p.num_bytes); 157 free(p.num_bytes);
158 free(p.elements); 158 free(p.elements);
159 } 159 }
160
161 struct TwoPhaseActionParams MallocTwoPhaseActionParams() {
162 struct TwoPhaseActionParams p;
163 p.buffer = (void**)malloc(sizeof(void*));
164 p.num_bytes = (uint32_t*)malloc(sizeof(uint32_t));
165 return p;
166 }
167
168 void FreeTwoPhaseActionParams(struct TwoPhaseActionParams p) {
169 free(p.buffer);
170 free(p.num_bytes);
171 }
OLDNEW
« no previous file with comments | « mojo/public/go/system/c_allocators.h ('k') | mojo/public/go/system/data_pipe.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698