BucketBrigade::BucketBrigade(const String& data) { PackedArrayInit ai(2); ai.append(data); ai.append(data.length()); auto bucket = g_context->createObject(s_bucket_class.get(), ai.toArray()); appendBucket(Object::attach(bucket)); }
struct bucket *createAndAppendBucket(struct bucketString *pStr) { struct bucket *pBkt; if (pStr == NULL) return NULL; /* Initialize and append new bucket */ pBkt = newBucket(pStr->defSize); appendBucket(pStr, pBkt); return pBkt; }
void HHVM_FUNCTION(stream_bucket_append, const Resource& bb_res, const Object& bucket) { auto brigade = bb_res.getTyped<BucketBrigade>(); assert(brigade); brigade->appendBucket(bucket); }
void HHVM_FUNCTION(stream_bucket_append, CResRef bb_res, CObjRef bucket) { auto brigade = bb_res.getTyped<BucketBrigade>(); assert(brigade); brigade->appendBucket(bucket); }